package com.easy.common.enumbean;

import com.baomidou.mybatisplus.annotation.EnumValue;

public enum OrderStatus {
//    待付款,已成交,已取消
    OBLIGATION("待付款"),TRANSACTED("已成交"),CANCELLED("已取消");
    @EnumValue
    private String value;
    private OrderStatus(String value){
        this.value=value;
    }
    public  OrderStatus convert(String val){
        switch (val){
            case "待付款":
                return OBLIGATION;
            case "已成交":
                return TRANSACTED;
            case "已取消":
                return CANCELLED;
            default:
                throw new RuntimeException("没有对应的枚举类型");
        }
    }

    public String valueOf(){
        return this.value;
    }
    public String toString(){
        return this.value;
    }
}
